{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 模型使用----Qwen-Fin-14B-Chat"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 模型使用----Qwen-7B-Chat"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 模型使用----Qwen-7B-Chat-NER-Lora"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 模型使用----Qwen-7B-Chat-SQL-Lora"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 模型使用----bge-m3-词嵌入embedding"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\python\\lib\\site-packages\\torch\\_utils.py:831: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()\n",
      "  return self.fget.__get__(instance, owner)()\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-0.0342    -0.04712   -0.0009046 ...  0.04828    0.007534  -0.02962  ]\n"
     ]
    }
   ],
   "source": [
    "from FlagEmbedding import BGEM3FlagModel\n",
    "\n",
    "model = BGEM3FlagModel('./embedding_model',  \n",
    "                       use_fp16=True) # Setting use_fp16 to True speeds up computation with a slight performance degradation\n",
    "\n",
    "sentences_1 = \"What is BGE M3?\"\n",
    "sentences_2 = [\"BGE M3 is an embedding model supporting dense retrieval, lexical matching and multi-vector interaction.\"]\n",
    "\n",
    "embeddings_1 = model.encode(sentences_1, \n",
    "                            batch_size=12, \n",
    "                            max_length=8192, # If you don't need such a long length, you can set a smaller value to speed up the encoding process.\n",
    "                            )['dense_vecs']\n",
    "# embeddings_2 = model.encode(sentences_2)['dense_vecs']\n",
    "# similarity = embeddings_1 @ embeddings_2.T\n",
    "print(embeddings_1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-0.034210205078125, -0.047119140625, -0.0009045600891113281, -0.0469970703125, 0.040069580078125, -0.0765380859375, -0.0018568038940429688, 0.00766754150390625, -0.01313018798828125, -0.007480621337890625, -0.0711669921875, 0.0526123046875, 0.0215911865234375, -0.041778564453125, 0.0005984306335449219, -0.052947998046875, 0.0080108642578125, -0.042999267578125, 0.01218414306640625, -0.00608062744140625, -0.0187835693359375, -0.0122222900390625, -0.004436492919921875, 0.00894927978515625, 0.0208587646484375, 0.0260772705078125, 0.013275146484375, 0.0214080810546875, 0.007965087890625, 0.007282257080078125, -0.07708740234375, -0.00994873046875, -0.005825042724609375, 0.005611419677734375, -0.01496124267578125, -0.0240631103515625, -0.01456451416015625, 0.01366424560546875, -0.05426025390625, -0.0278778076171875, -0.0113677978515625, 0.029541015625, 0.0770263671875, -0.01348114013671875, -0.06744384765625, -0.005096435546875, 0.01143646240234375, -0.0106353759765625, -0.01399993896484375, -0.06341552734375, 0.009429931640625, -0.0107421875, -0.04931640625, -0.021392822265625, 0.07177734375, 0.04974365234375, -0.0167083740234375, 0.03741455078125, -0.0146484375, -0.0117950439453125, -0.010101318359375, 0.0292510986328125, 0.006145477294921875, 0.0279388427734375, 0.03375244140625, 0.0198516845703125, -0.0203399658203125, 0.01116180419921875, -0.0035228729248046875, 0.00963592529296875, -0.053558349609375, 0.01064300537109375, -0.0194091796875, -0.0047454833984375, -0.08026123046875, 0.005496978759765625, 0.0136566162109375, -0.01558685302734375, -0.0265960693359375, -0.0085601806640625, 0.031341552734375, -0.030609130859375, -0.04937744140625, -0.00118255615234375, 0.018798828125, 0.06121826171875, -0.0026035308837890625, -0.017974853515625, -0.05419921875, -0.0162353515625, -0.0205230712890625, 0.037322998046875, -0.01485443115234375, -0.07421875, -0.07244873046875, 0.0297393798828125, -0.0225067138671875, 0.024017333984375, -0.00699615478515625, 0.00672149658203125, -0.0002951622009277344, 0.01340484619140625, 0.0134429931640625, 0.0166778564453125, -0.03228759765625, -0.0016469955444335938, 0.054168701171875, -0.006656646728515625, -0.056365966796875, -0.0190582275390625, 0.0025730133056640625, -0.0335693359375, 0.00579071044921875, -0.01495361328125, -0.033111572265625, -0.017730712890625, -0.0753173828125, 0.00881195068359375, 0.01556396484375, 0.00861358642578125, 0.00270843505859375, -0.01078033447265625, 0.0219268798828125, -0.0411376953125, -0.0010747909545898438, -0.056304931640625, 0.036895751953125, 0.031951904296875, 0.0225372314453125, -0.04150390625, -0.0308990478515625, 0.03570556640625, -0.025634765625, -0.0222015380859375, 0.0027294158935546875, -0.033050537109375, -0.01274871826171875, 0.0279388427734375, 0.02362060546875, -0.039276123046875, -0.001155853271484375, 0.04638671875, -0.0244293212890625, 0.004871368408203125, 0.030517578125, -0.01113128662109375, 0.007755279541015625, -0.00621795654296875, -0.005764007568359375, -0.02838134765625, 0.006839752197265625, 0.026153564453125, -0.04779052734375, -0.06744384765625, -0.03741455078125, -0.0277862548828125, 0.0162200927734375, 0.009613037109375, -0.07769775390625, 0.024261474609375, 0.034881591796875, -0.026580810546875, -0.0147857666015625, -0.031280517578125, 0.0014352798461914062, 0.0304107666015625, 0.004367828369140625, 0.01535797119140625, 0.01202392578125, -0.0159454345703125, 0.0268707275390625, 0.04302978515625, 0.0274200439453125, 0.044647216796875, 0.0297393798828125, 0.017822265625, 0.014923095703125, -0.0214996337890625, 0.01198577880859375, -0.0192413330078125, -0.032501220703125, 0.0033206939697265625, 0.003192901611328125, -0.05523681640625, -0.0249481201171875, 0.0643310546875, -0.037139892578125, -0.0401611328125, 0.01470184326171875, 0.04071044921875, -0.03369140625, 0.0333251953125, 0.05572509765625, 0.02825927734375, 0.0016956329345703125, -0.0086669921875, 0.044586181640625, 0.00562286376953125, 0.02996826171875, -0.0183563232421875, -0.01161956787109375, 0.024505615234375, 0.0323486328125, -0.0027179718017578125, 0.0097808837890625, -0.032989501953125, -0.022186279296875, 0.0189056396484375, -0.040771484375, -0.04327392578125, -0.0316162109375, -0.0001857280731201172, 0.037353515625, -0.02691650390625, 0.00531005859375, -0.0245513916015625, 0.0247650146484375, -0.00691986083984375, -0.01654052734375, 0.002933502197265625, -0.01055145263671875, 0.004962921142578125, 0.0225372314453125, -0.033935546875, -0.043121337890625, -0.01288604736328125, 0.0292510986328125, 0.05859375, 0.00926971435546875, 0.020233154296875, -0.042755126953125, -0.01198577880859375, 0.005031585693359375, 0.01904296875, 0.0145416259765625, 0.025238037109375, -0.03472900390625, 0.025360107421875, 0.04669189453125, 0.00016677379608154297, -0.005672454833984375, 0.0257110595703125, -0.0124664306640625, -0.00809478759765625, 0.0262603759765625, 0.045013427734375, -0.0220489501953125, 0.045166015625, -0.0292205810546875, 0.022857666015625, 0.0116729736328125, -0.0290374755859375, -0.0849609375, 0.033905029296875, 0.01293182373046875, 0.00531005859375, -0.034393310546875, 0.0145263671875, 0.049835205078125, 0.0015611648559570312, 0.0211029052734375, 0.0281524658203125, 0.035125732421875, 0.0207977294921875, 0.00836181640625, -0.026702880859375, 0.0046539306640625, 0.0004763603210449219, -0.01500701904296875, 0.01052093505859375, -0.03302001953125, -0.02056884765625, -0.0009021759033203125, 0.0484619140625, 0.0188751220703125, 0.0024318695068359375, 0.00930023193359375, -0.06329345703125, 0.0159454345703125, -0.033203125, -0.002819061279296875, 0.0150299072265625, -0.044219970703125, 0.050262451171875, 0.04974365234375, -0.032379150390625, -0.03985595703125, 0.000881195068359375, 0.0017843246459960938, -0.0233154296875, 0.001033782958984375, 0.01010894775390625, 0.0151214599609375, -0.02886962890625, 0.0020008087158203125, -0.0237884521484375, -0.03564453125, -0.1026611328125, -0.016387939453125, -0.01195526123046875, -0.031341552734375, 0.00994110107421875, -0.037628173828125, -0.02301025390625, 0.00392913818359375, 0.01154327392578125, 0.0038604736328125, -0.005279541015625, -0.02978515625, -0.0160980224609375, -0.01678466796875, -0.0007991790771484375, -0.037078857421875, 0.029571533203125, 0.034393310546875, -0.01561737060546875, -0.024444580078125, -0.02691650390625, 0.00424957275390625, 0.02435302734375, 0.048370361328125, -0.005283355712890625, -0.0013208389282226562, 0.02130126953125, 0.0248870849609375, 0.009124755859375, -0.0072021484375, -0.046539306640625, 0.0200653076171875, 0.0215911865234375, 0.05718994140625, 0.009521484375, 0.01203155517578125, -0.01419830322265625, -0.01419830322265625, 0.028594970703125, -0.0174407958984375, -0.023193359375, 0.054901123046875, 0.005764007568359375, 0.00981903076171875, -0.01250457763671875, -0.0225830078125, 0.031219482421875, -0.027099609375, -0.0654296875, -0.01491546630859375, -0.01119232177734375, 0.04266357421875, -0.0035686492919921875, -0.00841522216796875, 0.00592041015625, 0.006381988525390625, -0.0145416259765625, 0.052978515625, 0.00849151611328125, -0.034698486328125, 0.0206756591796875, 0.07470703125, 0.00804901123046875, 0.044403076171875, -0.07073974609375, -0.0158843994140625, 0.0330810546875, -0.06036376953125, 0.00675201416015625, 0.001728057861328125, -0.01097869873046875, 0.0350341796875, 0.0171661376953125, -0.00428009033203125, -0.0008225440979003906, 0.05450439453125, -0.06610107421875, 0.006717681884765625, -0.0046234130859375, -0.073486328125, 0.0015773773193359375, 0.0084381103515625, -0.00044417381286621094, 0.0191497802734375, 0.069091796875, -0.004756927490234375, -0.002040863037109375, 0.04388427734375, -0.0117034912109375, 0.1644287109375, -0.0005331039428710938, 0.0033092498779296875, 0.00894927978515625, -2.2292137145996094e-05, 0.0295257568359375, -0.0235748291015625, 0.00879669189453125, -0.0014181137084960938, -0.004703521728515625, 0.03851318359375, -0.060546875, 0.03778076171875, 0.0003247261047363281, -0.04931640625, 0.02490234375, -0.0279388427734375, 0.0062713623046875, 0.03997802734375, 0.0301971435546875, -0.0178375244140625, 0.0025653839111328125, 0.01198577880859375, 0.044158935546875, -0.0031719207763671875, -0.047393798828125, 0.01708984375, 0.02545166015625, -0.00823974609375, 0.046356201171875, -0.0022296905517578125, -0.063720703125, 0.01520538330078125, 0.0187530517578125, -0.049774169921875, 0.0200958251953125, -0.01849365234375, 0.01218414306640625, 0.0210113525390625, 0.0391845703125, 0.041900634765625, -0.01050567626953125, 0.0171966552734375, 0.043548583984375, 0.008544921875, -0.035858154296875, -0.027618408203125, -0.01934814453125, -0.01367950439453125, 0.048004150390625, -0.017303466796875, -0.01293182373046875, 0.0088653564453125, -0.0224151611328125, -0.0312347412109375, 0.03515625, -0.031097412109375, -0.010650634765625, -0.03131103515625, 0.00766754150390625, 0.044189453125, -0.0318603515625, -0.0229034423828125, -0.035308837890625, -0.0012235641479492188, -0.02752685546875, 0.02789306640625, 0.06414794921875, 0.045928955078125, 0.04437255859375, 0.0176849365234375, 0.0190277099609375, -0.0268096923828125, 0.10675048828125, 0.052154541015625, 0.0679931640625, 0.032318115234375, -0.01076507568359375, 0.0014791488647460938, 0.00650787353515625, 0.0220947265625, -0.0263214111328125, -0.0214385986328125, -0.0182342529296875, -0.02093505859375, -0.008941650390625, -0.031829833984375, 0.0172882080078125, 0.018310546875, -0.0124664306640625, 0.0240478515625, 0.0186920166015625, -0.0080108642578125, 0.0278472900390625, -0.0031795501708984375, -0.054443359375, 0.0188751220703125, -0.041778564453125, 0.0034694671630859375, 0.01296234130859375, -0.031585693359375, -0.050048828125, 0.040863037109375, 0.00601959228515625, -0.0321044921875, 0.045928955078125, 0.00513458251953125, -0.019775390625, 0.0009183883666992188, -0.0188140869140625, -0.02880859375, -0.0149078369140625, 0.0321044921875, -0.0290985107421875, -0.006969451904296875, -0.00951385498046875, -0.06121826171875, -0.05230712890625, 0.01337432861328125, 0.0310516357421875, 0.00977325439453125, -0.06060791015625, 0.01800537109375, 0.0172271728515625, -0.0260009765625, -0.0142364501953125, 0.00836944580078125, -0.00916290283203125, -0.0390625, 0.01461029052734375, -0.0164794921875, -0.020294189453125, -0.0065460205078125, -0.0198516845703125, 0.01546478271484375, -0.0009813308715820312, 0.0012722015380859375, 0.01861572265625, 0.030853271484375, 0.06707763671875, -0.01812744140625, -0.0032367706298828125, 0.011138916015625, -0.005405426025390625, -0.043731689453125, -0.03057861328125, 0.036163330078125, 0.0130157470703125, -0.032379150390625, -0.0264434814453125, -0.0252838134765625, 0.0628662109375, -0.043701171875, -0.042388916015625, -0.03985595703125, -0.0015583038330078125, 0.025054931640625, -0.0455322265625, -0.00807952880859375, 0.0187225341796875, -0.02020263671875, -0.03582763671875, -0.0195770263671875, 0.05413818359375, -0.0115509033203125, 0.0767822265625, 0.014801025390625, 0.01190185546875, 0.029541015625, -0.043853759765625, -0.006671905517578125, -0.003604888916015625, -0.00559234619140625, 0.0635986328125, 0.0175933837890625, 0.057403564453125, -0.0003364086151123047, -0.0278167724609375, 0.04144287109375, 0.038848876953125, 0.0263671875, 0.0048370361328125, -0.00170135498046875, 0.05792236328125, -0.056732177734375, 0.034423828125, -0.00017154216766357422, -0.00989532470703125, 0.03668212890625, 0.0261993408203125, 0.0443115234375, 0.06805419921875, -0.0192718505859375, 0.045318603515625, 0.035675048828125, -0.01629638671875, -0.0184478759765625, 0.00024271011352539062, 0.007904052734375, -0.0310211181640625, 0.0016908645629882812, 0.011077880859375, 0.026092529296875, -0.024932861328125, 0.06866455078125, -0.02716064453125, -0.044952392578125, -0.02850341796875, 0.056610107421875, 0.0194549560546875, -0.003086090087890625, -0.0216064453125, 0.0008716583251953125, -0.0021152496337890625, 0.003528594970703125, 0.008636474609375, -0.007396697998046875, 0.0016031265258789062, 0.0299835205078125, -0.03753662109375, -0.017791748046875, 0.00748443603515625, 0.01055908203125, -0.06304931640625, 0.01525115966796875, 0.035980224609375, -0.01157379150390625, -0.040771484375, 0.0277099609375, 0.04925537109375, 0.017913818359375, 0.036285400390625, -0.059906005859375, -0.0467529296875, -0.031494140625, 0.00043773651123046875, -0.019378662109375, -0.0111083984375, -0.0106353759765625, -0.01702880859375, -0.039154052734375, -0.01404571533203125, 0.046478271484375, 0.038116455078125, 0.0007009506225585938, 0.0189666748046875, -0.015167236328125, 0.04132080078125, 0.040863037109375, -0.040252685546875, -0.01265716552734375, 0.03955078125, 0.06488037109375, -0.0310211181640625, -0.0548095703125, -0.011871337890625, -0.033905029296875, 0.004039764404296875, 0.0261077880859375, 0.028106689453125, 0.0083465576171875, 0.031280517578125, -0.0108795166015625, 0.0086822509765625, -0.017364501953125, 0.0017156600952148438, -0.00620269775390625, 0.0127716064453125, -0.0008578300476074219, -0.00978851318359375, -0.041290283203125, -0.08428955078125, -0.0310211181640625, -0.03564453125, -0.0136260986328125, -0.004627227783203125, -0.06756591796875, 0.040069580078125, -0.001708984375, 0.01474761962890625, 0.034393310546875, 0.002593994140625, -0.0355224609375, -0.00408172607421875, -0.041168212890625, -0.0187835693359375, 0.0022983551025390625, -0.0152435302734375, -0.01103973388671875, -0.01087188720703125, 0.01421356201171875, 0.0179443359375, -0.038299560546875, -0.06866455078125, -0.032989501953125, 0.0251617431640625, -0.058197021484375, 0.01202392578125, -0.01690673828125, -0.045379638671875, -0.03192138671875, 0.04876708984375, 0.0015516281127929688, -0.007236480712890625, -0.007747650146484375, -0.00777435302734375, -0.00498199462890625, -0.0199127197265625, 0.033233642578125, 0.06390380859375, -0.0034999847412109375, 0.0239410400390625, -0.0260162353515625, 0.01015472412109375, 0.023162841796875, 0.016693115234375, 0.0247650146484375, 0.0123291015625, -0.006237030029296875, 0.020538330078125, 0.0307769775390625, 0.0160675048828125, -0.01479339599609375, -0.0112762451171875, -0.0211639404296875, -0.049652099609375, -0.006633758544921875, -0.013824462890625, -0.01274871826171875, -0.039337158203125, -0.02301025390625, -0.0199127197265625, -0.0272216796875, -0.01122283935546875, 0.00499725341796875, 0.01971435546875, 0.038055419921875, 0.01186370849609375, 0.053375244140625, 0.002986907958984375, -0.0270233154296875, -0.01806640625, 0.028839111328125, -0.0150299072265625, -0.0069122314453125, -0.02264404296875, 0.0278778076171875, 0.00795745849609375, 0.0206298828125, -0.00788116455078125, 0.046173095703125, 0.05963134765625, 0.04547119140625, -0.03680419921875, -0.0146636962890625, -0.022430419921875, -0.007190704345703125, 0.032073974609375, 0.05108642578125, 0.00963592529296875, 0.0289154052734375, 0.020294189453125, -0.006580352783203125, 0.042144775390625, 0.0258331298828125, 0.0035400390625, 0.0411376953125, 0.0170135498046875, 0.0164337158203125, -0.09368896484375, 0.00394439697265625, -0.02642822265625, -0.01311492919921875, 0.0167388916015625, 0.029205322265625, -0.0177459716796875, 0.0170745849609375, -0.030242919921875, -0.02032470703125, 0.00899505615234375, -0.019744873046875, -0.03936767578125, 0.01183319091796875, 6.008148193359375e-05, 0.00952911376953125, 0.00850677490234375, -0.005924224853515625, -0.0276641845703125, 0.0125885009765625, -0.0024871826171875, -0.035247802734375, 0.0555419921875, -0.050079345703125, -0.00402069091796875, -0.0643310546875, -0.0008816719055175781, 0.0557861328125, -0.0322265625, -0.087158203125, -0.038421630859375, -0.00952911376953125, -0.01262664794921875, 0.00978851318359375, -0.00811004638671875, 0.006862640380859375, 0.03546142578125, 0.0212860107421875, -0.001392364501953125, 0.0218505859375, -0.0012426376342773438, 0.01375579833984375, -0.038818359375, -0.00490570068359375, 0.0191192626953125, 0.0051116943359375, 0.023712158203125, 0.01016998291015625, -0.01519012451171875, -0.042755126953125, 0.0280609130859375, 0.002452850341796875, 0.00771331787109375, -0.0330810546875, 0.031341552734375, -0.04498291015625, 0.0174713134765625, -0.0120391845703125, 0.00659942626953125, 0.029815673828125, 0.032623291015625, 0.042633056640625, -0.037200927734375, -0.022705078125, -0.0254669189453125, 0.007572174072265625, -0.01377105712890625, 0.0083770751953125, -0.008148193359375, -0.037628173828125, -0.002895355224609375, -0.00609588623046875, 0.031097412109375, -0.01751708984375, 0.0020656585693359375, -0.0090789794921875, 0.048675537109375, -0.02960205078125, -0.04486083984375, 0.001453399658203125, -0.04473876953125, -0.0391845703125, 0.01287841796875, -0.0158233642578125, 0.005306243896484375, -0.035797119140625, 0.01387786865234375, 0.02899169921875, 0.0019683837890625, -0.02850341796875, 0.005401611328125, -0.0266876220703125, -0.01107025146484375, 0.00951385498046875, 0.050537109375, 0.0005869865417480469, 0.046966552734375, 0.0259246826171875, -0.020721435546875, 0.0070648193359375, 0.021087646484375, 0.030548095703125, -0.017547607421875, -0.031768798828125, -0.0078125, -0.038421630859375, -0.0164337158203125, -0.0133819580078125, -0.00960540771484375, -0.00443267822265625, -0.00963592529296875, 0.014495849609375, 0.05718994140625, 0.016143798828125, 0.029815673828125, -0.0309906005859375, -0.01544952392578125, 0.0103912353515625, -0.044891357421875, -0.04364013671875, 0.0452880859375, -0.035430908203125, -0.042327880859375, -0.056427001953125, -0.037200927734375, 0.0005769729614257812, 0.047027587890625, -0.03955078125, 0.060089111328125, 0.018310546875, 0.025634765625, 0.00653839111328125, -0.0190887451171875, 0.035888671875, 0.047607421875, 0.0117645263671875, 0.012451171875, 0.006565093994140625, -0.03387451171875, -0.04473876953125, 0.048248291015625, 0.011199951171875, -0.047607421875, -0.06103515625, 0.01110076904296875, -0.0004534721374511719, -0.0038299560546875, -0.0293731689453125, -0.013916015625, -0.0088653564453125, -0.01641845703125, -0.0224761962890625, 0.0051727294921875, 0.06719970703125, -0.045501708984375, 0.00913238525390625, -0.03057861328125, -0.00849151611328125, 0.00830078125, 0.04437255859375, 0.009429931640625, 0.0209503173828125, 0.04296875, -0.0377197265625, -0.07025146484375, 0.028045654296875, -0.0165557861328125, -0.049407958984375, 0.0124359130859375, 0.0206451416015625, -0.0213470458984375, -0.053253173828125, -0.00870513916015625, -0.086181640625, -0.01552581787109375, 0.0158538818359375, 0.0119171142578125, 0.0180206298828125, 0.0013065338134765625, 0.038055419921875, 0.0079498291015625, -0.0673828125, 0.052093505859375, -0.04327392578125, 0.04180908203125, -0.034027099609375, -0.056640625, 0.0172882080078125, -0.029083251953125, -0.002346038818359375, 0.0014495849609375, -0.01122283935546875, 0.0261383056640625, 0.00768280029296875, -0.0157470703125, 0.033447265625, 0.0135955810546875, 0.0020656585693359375, 0.040863037109375, 0.0201873779296875, -0.01480865478515625, 0.025604248046875, -0.01314544677734375, 0.0266265869140625, -0.031524658203125, 0.01409149169921875, 0.08331298828125, 0.0195770263671875, 0.0303802490234375, 0.0020427703857421875, 0.0198211669921875, -0.015167236328125, 0.0166778564453125, -0.004047393798828125, 0.012847900390625, 0.029205322265625, -0.041778564453125, 0.0335693359375, -0.008697509765625, 0.0182342529296875, 0.031280517578125, 0.01512908935546875, 0.028167724609375, -0.06512451171875, 0.0682373046875, -0.0161895751953125, 0.0058441162109375, 0.04833984375, -0.0169525146484375, -0.01087188720703125, -0.0225982666015625, -0.045257568359375, -0.054443359375, -0.006443023681640625, -0.0088958740234375, -0.0150146484375, 0.029510498046875, -0.0511474609375, 0.028045654296875, 0.03466796875, -0.028778076171875, 0.0259857177734375, -0.03179931640625, 0.056243896484375, 0.0023937225341796875, -0.011505126953125, -0.004642486572265625, 0.049041748046875, 0.0015239715576171875, 0.0084075927734375, -0.0085296630859375, -0.029205322265625, 0.04998779296875, 0.00750732421875, -0.0294036865234375, 0.0104217529296875, -0.032470703125, 0.0005192756652832031, 0.034820556640625, 0.03802490234375, -0.03363037109375, 0.0114288330078125, -0.00547027587890625, -0.006450653076171875, -0.0452880859375, 0.06585693359375, 0.04827880859375, 0.007534027099609375, -0.0296173095703125]\n"
     ]
    }
   ],
   "source": [
    "print(embeddings_1.tolist())"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 模型使用----bge-reranker-large-重排模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7.9609375\n"
     ]
    }
   ],
   "source": [
    "from FlagEmbedding import FlagReranker\n",
    "rerank_model = FlagReranker('./rerank_model', use_fp16=True) # Setting use_fp16 to True speeds up computation with a slight performance degradation\n",
    "query = '你是谁？'\n",
    "doc = '你是什么人？'\n",
    "score = rerank_model.compute_score([query,doc])\n",
    "print(score)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
